package com.bw.bean;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class OrderInfoWide1 {
    // 详情为详情
    private Long id;

    // 订单详情金额
    private BigDecimal amount;
    // 商品数量
    private Long sku_num;

    private Long order_info_id;
    // 套装的ID
    private Long product_group_id;

    // 商品ID
    private Long product_sku_id;

    // 店铺ID
    private Long shop_id;

    // 地区编码
    private String region_name;
    // 地区ID
    private Integer region_id;

    private Long product_spu_id;

    private String product_spu_name;

    // 创建时间
    private String create_time;

    // 更新时间
    private String update_time;




    public OrderInfoWide1() {

    }

    public OrderInfoWide1(OrderInfo orderInfo, OrderDetail orderDetail) {
        mergeOrderInfo(orderInfo);
        mergeOrderDetail(orderDetail);
    }

    public void mergeOrderInfo(OrderInfo orderInfo) {
        if (orderInfo != null) {
            this.shop_id = orderInfo.getShop_id();
        }
    }

    public void mergeOrderDetail(OrderDetail orderDetail) {
        if (orderDetail != null) {
            this.id = orderDetail.getId();

            this.product_sku_id = orderDetail.getProduct_sku_id();

            this.amount = orderDetail.getAmount();

            this.sku_num = orderDetail.getSku_num();

            this.order_info_id = orderDetail.getOrder_info_id();

            this.product_group_id = orderDetail.getProduct_group_id();

            this.create_time = orderDetail.getCreate_time();

            this.update_time = orderDetail.getUpdate_time();

        }
    }


}
